BUOC 1: Cai dat cau hinh POSTFIX =================================== myhostname = mail.concung.com mydomain = concung.com myorigin = $mydomain inet_interfaces = all mynetwork = 172.16.84.0/24 127.0.0.0/8 home_mailbox = Maildir/ =================================== BUOC 2: CAI DAT DOVECOT /etc/dovecot/conf.d/10-mail.conf ***************************************** mail_location = maildir:~/Maildir ***************************************** /etc/dovecot/conf.d/20-pop3.conf ***************************************** pop3_uidl_format = %08Xu%08Xv pop3_client_workarounds = outlook-no-nuls oe-ns-eoh ***************************************** /etc/dovecot/dovecot.conf ******************************************* protocols = imap pop3 lmtp disable_plaintext_auth=no ******************************************* #service dovecot restart #chkconfig --level 35 dovecot on Buoc 3: CAI DAT VA CAU HINH MOD_SSL (https) #yum install mod_ssl #cd /etc/pki/tls/certs #make server.key ===>Nhap password is : p@ssw0rd #openssl rsa -in server.key -out server.key ===>nhap password is : p@ssw0rd #root@mail certs# make server.csr ****************************************************************** Enter password is : p@ssw0rd Country Name (2 letter code): vn State or Provice Name (Full Name): hcmcity Locality Name (eg, city) : hcmcity Organization Name(eg, company): lytutrongcollege Organization Unit (eg, section): khoacnttltt Common Name (eg, your name or your server's hostname : www.concung.com Mail address: ltthcm@gmail.com others: bo trong !!!! ******************************************************************** #openssl x509 -in server.csr -out server.crt -req -signkey server.key -days 3650 CAU HINH httpd.conf voi noi dung sau: /etc/httpd/conf.d/ssl.conf *********************************************** DocumentRoot "/var/www/html" ServerName www.concung.com:443 SSLCertificateFile /etc/pki/tls/certs/server.crt SSLCertificateKeyFile /etc/pki/tls/certs/server.key *********************************************** BUOC 4: CAI DAT SQUIRRELMAIL #yum install epel-release #yum install squirrelmail /etc/httpd/conf.d/squirrelmail.conf *********************************************** Alias /webmail /usr/share/squirrelmail Deny from all RewriteEngine on RewriteCond %{HTTP} !=on RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST} ************************************************* #service httpd restart #service iptables stop #setsebool httpd_can_network_connect=1 (HERE !!!!) This will add the change to your /etc/selinux/targeted/booleans file and will be applied at each reboot #setsebool -P httpd_can_sendmail 1 BƯỚC 5 : TEST KET QUA TỪ MÁY XP PROFESSIONAL --------------------------------------------the end !----------------------------------------------------------- 1- Huong dan cau hinh mail Postfix,devecot, squirrelmail Link: https://support.rackspace.com/how-to/dovecot-installation-and-configuration-on-centos/ 2-How To Configure a Mail Server Using Postfix, Dovecot, MySQL, and SpamAssassin Link: https://www.digitalocean.com/community/tutorials/how-to-configure-a-mail-server-using-postfix-dovecot-mysql-and-spamassassin 3-How to config squirrelmail: https://www.rosehosting.com/blog/how-to-install-squirrelmail-on-centos-7/ Buoc 1: yum -y install epel-release Buoc 2: yum -y install squirrelmail 4-Thiet lap thong so boolean SElinux https://www.certdepot.net/selinux-use-boolean-settings/ Ghi chu: Noi dung file cau hinh /etc/httpd/conf.d/squirrelmail.conf nhu sau ============================================================================== Alias /webmail /usr/share/squirrelmail Deny from all # this section makes squirrelmail use https connections only, for this you # need to have mod_ssl installed. If you want to use unsecure http # connections, just remove this section: RewriteEngine on # RewriteCond %{HTTPS} !=on # RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} ============================================================================== #service iptables stop #setsebool httpd_can_network_connect=1 (HERE !!!!) This will add the change to your /etc/selinux/targeted/booleans file and will be applied at each reboot #setsebool -P httpd_can_sendmail 1 /etc/hosts ip domainname hostname /etc/sysconfig/network hostname HUONG DAN CAI DAT VA THIET LAP SQUIRRELMAIL